package org.hadoop.maxtempcalculator;

import java.io.IOException;

import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.FileInputFormat;
import org.apache.hadoop.mapred.FileOutputFormat;
import org.apache.hadoop.mapred.JobClient;
import org.apache.hadoop.mapred.JobConf;

public class OldMaxTemperature {

	public static void main(String[] args) throws IOException {

		String input = "/hadoop_input/max_temp";
		String output = "/hadoop_output/max_temp";

		JobConf conf = new JobConf(OldMaxTemperature.class);
		conf.setJobName("Max temperature");

		FileInputFormat.addInputPath(conf, new Path(input));
		FileOutputFormat.setOutputPath(conf, new Path(output));

		conf.setMapperClass(OldMaxTemperatureMapper.class);
		conf.setCombinerClass(OldMaxTemperatureReducer.class)/* ] */;
		conf.setReducerClass(OldMaxTemperatureReducer.class);

		conf.setOutputKeyClass(Text.class);
		conf.setOutputValueClass(IntWritable.class);

		JobClient.runJob(conf);
	}
}
